# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=device-google-trogdor
pkgdesc="Google Trogdor Chromebooks"
pkgver=4
pkgrel=1
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	alsa-ucm-conf
	depthcharge-tools
	linux-postmarketos-qcom-sc7180
	postmarketos-base
	postmarketos-cros-common
	soc-qcom-sc7180
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo modules-initfs"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

nonfree_firmware() {
	pkgdesc="WiFi/BT, Modem, GPU, Venus firmware"
	depends="
		linux-firmware-qcom
		linux-firmware-qca
		linux-firmware-ath10k
		firmware-google-trogdor
		soc-qcom-sc7180-nonfree-firmware
		msm-cros-efs-loader
	"
	mkdir "$subpkgdir"
}

openrc() {
	install_if="$pkgname=$pkgver-r$pkgrel openrc"
	depends="eudev-hwids"
	mkdir "$subpkgdir"
}

sha512sums="
f94dcb175e49cbaadce524586ed1c3e3b0182e414c84c495a5585b49ed40ca6f7fa9c73544d19cbad236333f9fd997f150f836452b47a271f99b7b059972c4bc  deviceinfo
ef0257928f28aff25e6c625fabfd0942b01d4d86f1b523212ca825cf80f8b7a6c20ff17bfb02cb19f2a5d8787326ba22ad560a957c8d3c38b9ec70f1e16f9117  modules-initfs
"
